Skip to content

SD command queueing take 2 - #6076

Merged
pelwell merged 5 commits into
raspberrypi:rpi-6.6.yfrom
P33M:sd_a2_x2
Mar 27, 2024
Merged

pelwell merged 5 commits into
raspberrypi:rpi-6.6.yfrom
P33M:sd_a2_x2

Conversation

@P33M

@P33M P33M commented Mar 27, 2024

Copy link
Copy Markdown
Contributor

This series adds more robustness when deciding whether to use CQE, adds some user-accessible debug and fixes up some omissions in error handling.

P33M added 2 commits March 27, 2024 13:41
The eMMC spec says that in certain circumstances the controller can't
respond to a halt request - in practice, this occurs if a CMD
timeout happens (card went away/crashed).

Clear the halt request by writing 0 to CQHCI_CTL. Also fix a logic error
testing for halt in cqhci_request.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
Certain status bits in these registers may need polling outside of
SD-specific code. Export in sd_ops.h

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
Comment thread drivers/mmc/core/sd_ops.c Outdated
/* Poll the register - cards may have a lazy init/deinit sequence. */
timeout = ktime_add_ms(ktime_get(), 10);
while (1) {
timedout = ktime_after(ktime_get(), timeout);

@pelwell pelwell Mar 27, 2024 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have to check for timeout here? It's counterintuitive, and will result in one extra read after the timeout has elapsed. If intentional, it warrants a comment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The timeout length is arbitrary, but the boolean can be removed - no real need to store it separately.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good - it will remove the feeling that something clever might be happening.

P33M added 3 commits March 27, 2024 14:32
Don't attempt to turn on CQ if the other mandatory features are not
indicated as supported by the card. Also make sure that the register write
actually stuck, as some cards claim support but never report back that
the queue engine is enabled.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
Also report the card's supported queue depth in the message log.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
The spec allows for up to two 512-byte pages to be allocated for the
Extension Register General Info block, so allocate accordingly.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
@pelwell
pelwell merged commit b16e3d3 into raspberrypi:rpi-6.6.y Mar 27, 2024
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Mar 27, 2024
See: raspberrypi/linux#6076

kernel: i2c: designware: Add support for bus clear feature
See: raspberrypi/linux#6071

kernel: RTC PCF2131 support
See: raspberrypi/linux#6070

kernel: allo-boss-dac mute output when changing parameters
See: raspberrypi/linux#6074

kernel: dts: bcm2712: Add blpubkey nvram node
See: raspberrypi/linux#6073

kernel: drivers: sdhci-brcmstb: work around mystery CQE CMD_IDLE_TIMER trampling
See: raspberrypi/linux#6060

kernel: drm/vc4: Enable bg_fill if there are no planes enabled
See: raspberrypi/linux#6066

kernel: ARM: dts: bcm2712: Add the missing L1/L2/L3 cache information
See: raspberrypi/linux#6061
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Mar 27, 2024
See: raspberrypi/linux#6076

kernel: i2c: designware: Add support for bus clear feature
See: raspberrypi/linux#6071

kernel: RTC PCF2131 support
See: raspberrypi/linux#6070

kernel: allo-boss-dac mute output when changing parameters
See: raspberrypi/linux#6074

kernel: dts: bcm2712: Add blpubkey nvram node
See: raspberrypi/linux#6073

kernel: drivers: sdhci-brcmstb: work around mystery CQE CMD_IDLE_TIMER trampling
See: raspberrypi/linux#6060

kernel: drm/vc4: Enable bg_fill if there are no planes enabled
See: raspberrypi/linux#6066

kernel: ARM: dts: bcm2712: Add the missing L1/L2/L3 cache information
See: raspberrypi/linux#6061
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants